(function(){"use strict";BX.namespace("BX.Rest.MarketPartners.TileGrid.Item");if(!BX.TileGrid){return false}BX.Rest.MarketPartners.TileGrid.Item=function(t){BX.TileGrid.Item.apply(this,arguments);this.title=t.title;this.description=t.description;this.icon=t.icon;this.link=t.link;this.payment=t.price;this.infoHelperCode=t.infoHelperCode;this.layout={wrapper:null,title:null,description:null,icon:null}};BX.Rest.MarketPartners.TileGrid.Item.prototype={__proto__:BX.TileGrid.Item.prototype,constructor:BX.TileGrid.Item,getContent:function(){if(!this.layout.wrapper){this.layout.wrapper=BX.create("div",{props:{className:"rest-market-partners-wrapper"},children:[this.getIconNode(),BX.create("div",{props:{className:"rest-market-partners-content"},children:[this.getTitle(),this.getDescription(),this.getLinkNode()]})]})}return this.layout.wrapper},getIconNode:function(){if(!this.layout.icon){this.layout.icon=BX.create("div",{props:{className:"rest-market-partners-icon"},children:[BX.create("img",{props:{className:"rest-market-partners-icon-image",src:this.icon}})]})}return this.layout.icon},getTitle:function(){if(!this.layout.title){this.layout.title=BX.create("div",{props:{className:"rest-market-partners-title"},text:this.title})}return this.layout.title},getDescription:function(){if(!this.layout.description){this.layout.description=BX.create("div",{props:{className:"rest-market-partners-description"},text:this.description})}return this.layout.description},getLinkNode:function(){var t=BX.create("a",{props:{className:"ui-btn ui-btn-sm ui-btn-primary ui-btn-round",href:this.link},text:BX.message("REST_MARKETPLACE_CATEGORY_INSTALL_LINK_NAME")});if(this.infoHelperCode!==false){t=BX.create("span",{props:{className:"ui-btn ui-btn-sm ui-btn-primary ui-btn-round"},events:{click:BX.delegate(function(){top.BX.UI.InfoHelper.show(this.infoHelperCode)},this)},text:BX.message("REST_MARKETPLACE_CATEGORY_INSTALL_LINK_NAME")})}return BX.create("div",{props:{className:"rest-market-partner-link-wrapper"},children:[t,this.payment?BX.create("span",{props:{className:"rest-market-partners-price"},text:this.payment}):null]})},clipDescription:function(){if(!this.layout.description){return}BX.cleanNode(this.layout.description);var t=BX.create("span",{text:this.description});this.layout.description.appendChild(t);var e=this.layout.description.offsetHeight;var i=this.description;var r=0;while(e<=t.offsetHeight&&i.length>r){r=r+2;t.innerText=i.slice(0,-r)+"..."}},clipTitle:function(){if(!this.layout.title){return}BX.cleanNode(this.layout.title);var t=BX.create("span",{text:this.title});this.layout.title.appendChild(t);var e=this.layout.title.offsetHeight;var i=this.title;var r=0;while(e<=t.offsetHeight&&i.length>r){r=r+2;t.innerText=i.slice(0,-r)+"..."}},afterRender:function(){if(this.description){this.clipDescription()}if(this.title){this.clipTitle()}}}})();
//# sourceMappingURL=script.map.js